package cn.jiyun.service;

import cn.jiyun.mapper.GoodsMapper;
import cn.jiyun.pojo.Goods;
import cn.jiyun.pojo.Range;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class GoodsService {
    @Autowired(required = false)
    private GoodsMapper goodsMapper;
    public List<Goods> getAll(){
        return goodsMapper.getAll();
    }

    public List<Goods> getSp(String name) {
        if (StringUtils.isNotBlank(name)){
            return goodsMapper.getBySname(name);
        }
        return goodsMapper.getAll();
    }
}
